package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.pojo.entity.Partner;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PartnerMapper extends BaseMapper<Partner> {
    //合作商分页搜索(动态查询)
    List<Partner> getPartnerList(String name);
    //新增合作商
    Boolean save(Partner partner);
    //通过id获取合作商详情
    @Select("select * from tb_partner where id =#{id}")
    Partner getPartById(String id);

    //根修改合作商信息
    Boolean update(String id ,Partner partner);

    //删除合作商
    @Delete("delete  from tb_partner where id =#{id}")
    Boolean delete(String id);
}
